package logic

import (
	"context"
	"me/123/common/proto/product"
	"me/123/service/server"
)

type ProductServer struct {
	product.UnimplementedProductsServer
}

func (p ProductServer) ProductList(ctx context.Context, req *product.ProductListRequest) (*product.ProductListResponse, error) {
	products, err := server.ProductList(req)
	if err != nil {
		return nil, err
	}
	return products, nil
}

func (p ProductServer) List(ctx context.Context, req *product.ListRequest) (*product.ListResponse, error) {
	products, err := server.List(req)
	if err != nil {
		return nil, err
	}
	return products, nil
}

func (p ProductServer) UserList(ctx context.Context, req *product.UserListRequest) (*product.UserListResponse, error) {
	products, err := server.UserList(req)
	if err != nil {
		return nil, err
	}
	return products, nil
}
